package com.eastfair.certificate.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.auth.dto.UserAccountDto;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperCacheService;
import com.eastfair.boot.service.SuperService;
import com.eastfair.certificate.dto.CertificateDTO;
import com.eastfair.certificate.dto.CertificateOrderDTO;
import com.eastfair.certificate.dto.CertificateUserDTO;
import com.eastfair.certificate.entity.Blacklist;
import com.eastfair.certificate.entity.CertificateUser;
import com.eastfair.certificate.enumeration.BlacklistKindEnum;
import com.eastfair.certificate.vo.CertificateUserVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 业务接口
 * 用户填写的制证信息
 * </p>
 *
 * @author ligang
 * @date 2022-07-22
 */
public interface CertificateUserService extends SuperCacheService<CertificateUser> {
    /**
     * do转vo
     *
     * @param model
     */
    CertificateUserVO doToVo(CertificateUser model);

    /**
     * do转vo
     *
     * @param modelList
     */
    List<CertificateUserVO> doToVos(List<CertificateUser> modelList);


    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<CertificateUser> list(CertificateUserDTO modelDTO, List<Long> ids);

    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<CertificateUser> listOfCache(CertificateUserDTO modelDTO, List<Long> ids);

    /**
     * 提交动态表单
     *
     * @param certificateUserDTO
     * @return
     */
    CertificateUser submitForm(CertificateUserDTO certificateUserDTO);


    /**
     * 初次审核表单
     *
     * @param certificateUserDTO
     * @return
     */
    List<CertificateUser> firstAuthForm(CertificateUserDTO certificateUserDTO);

    /**
     * 二次审核表单
     *
     * @param certificateUserDTO
     * @return
     */
    List<CertificateUser> secondAuthForm(CertificateUserDTO certificateUserDTO);


    /**
     * 查询审核表单
     *
     * @param params
     * @return
     */
    IPage<CertificateUserVO> pageFirstAuthForm(PageParams<CertificateUserDTO> params);

    QueryWrapper<CertificateUser> assembleQueryWrapper(CertificateUserDTO certificateUserDTO);

    /**
     * 查询审核表单
     *
     * @param certificateUserDTO
     * @return
     */
    List<CertificateUserVO> queryFirstAuthForm(CertificateUserDTO certificateUserDTO);

    /**
     * 组装业务数据，展会，公司，场地
     *
     * @param certificateUserVOList
     * @return
     */
    List<CertificateUserVO> assembleBusinssData(List<CertificateUserVO> certificateUserVOList);


    /**
     * 注销
     *
     * @return
     */
    Boolean clearCertificate(CertificateUserDTO certificateUserDTO);

    /**
     * 挂失
     *
     * @return
     */
    Boolean lessCertificate(CertificateUserDTO certificateUserDTO);

    /**
     * 加入黑名单
     *
     * @return
     */
    Boolean addBackCertificate(CertificateUserDTO certificateUserDTO);

    /**
     * 同步加入黑名单
     *
     * @param mobiles
     * @param cardNumbers
     * @param companyIds
     * @param exhibitionIdList
     * @return
     */
    Boolean sycnAddBackSertificate(List<String> mobiles, List<String> cardNumbers, List<Long> companyIds, List<Long> exhibitionIdList);

    /**
     * 同步解绑黑名单
     * @param mobiles
     * @param cardNumbers
     * @param companyIds
     * @param exhibitionIdList
     * @param noInExhibitionIdList
     * @return
     */
    Boolean sycnRemoveBackSertificate(List<String> mobiles, List<String> cardNumbers, List<Long> companyIds, List<Long> exhibitionIdList, List<Long> noInExhibitionIdList);


    /**
     * 领取人
     *
     * @param certificateOrderDTO
     */
    void drawOrderOfUser(CertificateOrderDTO certificateOrderDTO);


    /**
     * 领取
     *
     * @param certificateUserDTO
     */
    void draw(CertificateUserDTO certificateUserDTO);
}
